package com.android.myapplication.view;

import android.os.Bundle;
import android.view.View;
import android.widget.SeekBar;
import android.widget.Toast;

import com.android.myapplication.R;
import com.android.myapplication.main.BaseActvity;

public class BarActivity extends BaseActvity {
    Toast toast;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bar);
        init();
        SeekBar seekBar = findViewById(R.id.seekbar);
        toast =                 Toast.makeText(BarActivity.this, "", Toast.LENGTH_SHORT);

        seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {

                toast.setText("滑动值:" + progress);
                toast.show();

            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {
                toast.setText("开始滑动");
                toast.show();
            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {
                toast.setText("结束滑动");
                toast.show();
            }
        });
    }


}
